import java.util.Scanner; // 需要导入 util 包

import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: happyiu
 * Date: 2021-10-31
 * Time: 9:54
 */


class Person{
    public String name;
    public int age;

    public void eat(){
        System.out.println(name+"正在吃饭");
    }
    public void age(){
        System.out.println(name+"今年"+age+"岁");
    }

}

public class TestDemo {

        public static int sum(int a,int b){
            return a+b;
        }

        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            System.out.println("hello");
        }

    public static int fac(int n) {
        int ret = 1;
        for (int i = 1; i <= n; i++) {
            ret = ret *i;
        }
        return ret;
    }

    public static int facSum(int n) {
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum = sum + fac(i);
        }
        return sum;
    }

    public static void main14(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(facSum(n));
    }



    public static void main13(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 5; i++) {
            int tmp = 1;
            for (int j = 1; j <= i; j++) {
                tmp *= j;
            }
            sum += tmp;
        }
        System.out.println("sum = " + sum);
    }



    public static void main12(String[] args) {
        Person person = new Person();
        person.name ="bit";
        person.age = 25;
        System.out.println(person.name);
        System.out.println(person.age);
    }






    public static void main1(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 100; i++) {
            sum += i;
        }
        System.out.println("sum = " + sum);
        // 执行结果 5050
    }

    public static void main2(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 5; i++) {
            int tmp = 1;
            for (int j = 1; j <= i; j++) {
                tmp *= j;
            }
            sum += tmp;
        }
        System.out.println("sum = " + sum);
    }

    public static void main3(String[] args) {
        int a = 5;

        do{
            a++;
        }while (a<=10);
        System.out.println(a);

    }

    public static void main4(String[] args) {
        int a = 5;

        System.out.println("hello "+a); // 输出一个字符串, 带换行
        System.out.print("hello "+a); // 输出一个字符串, 不带换行
        System.out.printf("hello %d",a); // 格式化输出
    }

    public static void main5(String[] args) {
        System.out.println("hello world");
        int x = 10;
        System.out.printf("x = %d\n", x);
    }

    public static void main6(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的姓名：");
        String name = sc.nextLine();
        System.out.println("请输入你的年龄：");
        int age = sc.nextInt();
        System.out.println("请输入你的工资：");
        float salary = sc.nextFloat();
        System.out.println("你的信息如下：");
        System.out.println("姓名: "+name+"\n"+"年龄："+age+"\n"+"工资："+salary);
        sc.close(); // 注意, 要记得调用关闭方法


    }

    public static void main7(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        //创建一个int类型的变量a进行键盘读取
        String ch = scanner.nextLine();
        //创建一个字符串类型变量ch读取键盘输入
    }

    public static void main8(String[] args) {
        Scanner sc = new Scanner(System.in);
        double sum = 0.0;
        int num = 0;
        while (sc.hasNextDouble()) {
            //hasNext就是读完我还有要读的
            double tmp = sc.nextDouble();
            sum += tmp;
            num++;
        }
        System.out.println("sum = " + sum);
        System.out.println("avg = " + sum / num);
        sc.close();
    }

        public static void main9(String[] args) {
            Random random = new Random(); // 默认随机种子是系统时间
            Scanner sc = new Scanner(System.in);
            int toGuess = random.nextInt(100);
            // System.out.println("toGuess: " + toGuess);
            while (true) {
                System.out.println("请输入要输入的数字: (1-100)");
                int num = sc.nextInt();
                if (num < toGuess) {
                    System.out.println("猜大了");
                } else if (num > toGuess) {
                    System.out.println("猜小了");
                } else {
                    System.out.println("猜对了");
                    break;
                }
            }
            sc.close();
        }

        class People{

    }

}




